package com.hjc.springbootstudyweb.mapper;

import com.hjc.springbootstudyweb.entity.IndentModel;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: HJC
 * Date: 2019/12/1
 * Time: 21:57
 * To change this template use File | Settings | File Templates.
 */
public interface IndentMapping {

    @Select("select * from indent")
    @Results({
            @Result(property = "did" , column = "did"),
            @Result(property = "dealnum" , column = "dealnum")
    })
    List<IndentModel> queryIndent();

    @Select("select dealnum,pid,num,times from indent where uid=#{uid}")
    List<IndentModel> queryByIid(@Param("uid")int uid);

    @Insert("insert into indent(did,dealnum,uid,pid,num,times) values(#{did} ,#{dealnum},#{uid},#{pid},#{num},#{times})")
    int addIndent(IndentModel indentModel);

}
